export class Identity{
    constructor(name, level = 10){
        this.name = name || '';
        this.level = level;
    }
}

export function getIdentity(text, level){
    let identity = identitys.find(item => item.name === text);
    if(identity) {
        if(level) identity.level = level;
        return identity;
    }
    else return new Identity(text, level);
}

export const identitys = [
    new Identity('丰华村铁匠铺老板', 5),
    new Identity('丰华村村长', 10),
];